//package com.mysiteforme.admin.controller;
//
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.baomidou.mybatisplus.mapper.EntityWrapper;
//import com.baomidou.mybatisplus.plugins.Page;
//import com.mysiteforme.admin.base.BaseServiceController;
//import com.mysiteforme.admin.config.RestTemplateConfig;
//import com.mysiteforme.admin.entity.BlogTags;
//import com.mysiteforme.admin.entity.Greeting;
//import com.mysiteforme.admin.entity.Log;
//import com.mysiteforme.admin.model.User;
//import com.mysiteforme.bean.ResponseBean;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.apache.shiro.authz.annotation.RequiresAuthentication;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.SpringApplication;
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
//import org.springframework.context.annotation.Import;
//import org.springframework.http.MediaType;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.client.RestTemplate;
//
//import java.util.HashMap;
//import java.util.Map;
//
//@Controller
////@EnableAutoConfiguration
////@Import(value = {RestTemplateConfig.class})
//@RequestMapping(value = "/springrest", produces = MediaType.APPLICATION_JSON_VALUE)
//@Api(value = "基站节目信息", description = "基站节目信息操作API", tags = "ChannelApi", consumes = MediaType.APPLICATION_JSON_VALUE,
//        produces = MediaType.APPLICATION_JSON_VALUE)
//public class ChannelController  {
//
////    @Autowired
////    RestTemplate restTemplate;
//
//
//    @ApiOperation(value = "/addUser2", notes = "添加2个用户")
//    @RequestMapping(value = "addUser2", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
//    @ResponseBody
//    public User addUser2(@RequestBody User user) {
//
//        return user;
//    }
//
//
////    /***********HTTP GET method*************/
////    @RequestMapping("zz")
////    public String hellozz(){
////        Greeting quote = restTemplate.getForObject("http://rest-service.guides.spring.io/greeting", Greeting.class);
////        System.out.print(quote.getId() + "  " + quote.getContent());
////        return quote.getId() + "  " + quote.getContent();
////    }
////
////
////    /***********HTTP GET method*************/
////    @RequestMapping("")
////    public String hello(){
////        String url = "http://rest-service.guides.spring.io/greeting";
////        JSONObject json = restTemplate.getForEntity(url, JSONObject.class).getBody();
////        return json.toJSONString();
////    }
////
////    @RequestMapping("/json")
////    public Object genJson(){
////        JSONObject json = new JSONObject();
////        json.put("descp", "this is spring rest template sample");
////        return json;
////    }
//
////    @RequestMapping("/hello")
////    public String hello1(){
////        String url = "http://rest-service.guides.spring.io/greeting";
////        JSONObject json = restTemplate.getForEntity(url, JSONObject.class).getBody();
////        return json.toJSONString();
////    }
////
////    /**********HTTP POST method**************/
////    @RequestMapping("/postApi")
////    public Object iAmPostApi(@RequestBody JSONObject parm){
////        System.out.println(parm.toJSONString());
////        parm.put("result", "hello post");
////        return parm;
////    }
////
////    @RequestMapping("/post")
////    public Object testPost(){
////        String url = "http://localhost:8080/postApi";
////        JSONObject postData = new JSONObject();
////        postData.put("descp", "request for post");
////        JSONObject json = restTemplate.postForEntity(url, postData, JSONObject.class).getBody();
////        return json.toJSONString();
////    }
//
////    @ApiOperation(value = "/fccrepacktowers", notes = "获取基站的信息")
////    @RequestMapping(value = "fccrepacktowers",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
////    @ResponseBody
//////    @RequiresAuthentication
////    public Object FccRepackTowers(){
////        String url = "https://antennaweb.org/api/Prediction/FccRepackTowers";
////        JSONObject postData = new JSONObject();
////        postData.put("Latitude", 42.65287);
////        postData.put("Longitude", -73.74868);
////        postData.put("ReceiveHeight", "6.0");
////        postData.put("IsObstructed", "false");
////        Map data = new HashMap();
//////        {"Latitude":42.65287,"Longitude":-73.74868,"ReceiveHeight":"6.0","IsObstructed":"false"}
////        JSONArray json = restTemplate.postForEntity(url, postData, JSONArray.class).getBody();
////        data.put("list",json);
////
////        EntityWrapper<Log> wrapper = new EntityWrapper<>();
//////        Page<Log> logPage = logService.selectPage(new Page<>(1,10),wrapper);
////        ResponseBean bean =  new ResponseBean(200, "成功",null, data);
////        return bean;
////    }
//
////    @RequestMapping(value = "/programs")
////    @RequiresAuthentication
////    @ResponseBody
////    public Object Programs(){
////        String url = "https://antennaweb.org/api/Prediction/Programs";
////        JSONObject postData = new JSONObject();
//////        postData.put("phase", 0);
//////        postData.put("phaseCompletionDate", "");
//////        postData.put("goingDark", false);
//////        postData.put("channelChanging", "false");
//////        postData.put("oldRfChannel", 12);
//////        postData.put("coronadoStationId", 691);
//////        postData.put("callSign", "WNYT-DT");
//////        postData.put("parentCallSign", "WNYT-DT");
//////        postData.put("network", "NBC");
//////        postData.put("networkLogo", "");
//////        postData.put("ReceiveHeight", "6.0");
//////        postData.put("IsObstructed", "false");
//////        postData.put("Latitude", 42.65287);
//////        postData.put("Longitude", -73.74868);
//////        postData.put("ReceiveHeight", "6.0");
//////        postData.put("IsObstructed", "false");
////
////        String string = "        {\n" +
////                "            \"phase\": 0,\n" +
////                "                \"phaseCompletionDate\": \"\",\n" +
////                "                \"goingDark\": false,\n" +
////                "                \"channelChanging\": false,\n" +
////                "                \"oldRfChannel\": 12,\n" +
////                "                \"coronadoStationId\": 691,\n" +
////                "                \"callSign\": \"WNYT-DT\",\n" +
////                "                \"parentCallSign\": \"WNYT-DT\",\n" +
////                "                \"network\": \"NBC\",\n" +
////                "                \"networkLogo\": \"\",\n" +
////                "                \"rfChannel\": 12,\n" +
////                "                \"psipChannel\": \"13.1\",\n" +
////                "                \"distanceInMiles\": 13.412939739926026,\n" +
////                "                \"directionMagnetic\": 275.4292673461789,\n" +
////                "                \"directionTrue\": 261.92027991942109,\n" +
////                "                \"latitude\": 42.625277099999991,\n" +
////                "                \"longitude\": -74.00999999999857,\n" +
////                "                \"antennaColor\": \"Red\",\n" +
////                "                \"channelCount\": 1\n" +
////                "        }";
////
////        postData  = JSONObject.parseObject(string);
////
////
////        JSONArray json = restTemplate.postForEntity(url, postData, JSONArray.class).getBody();
////        return json;
////    }
//
//
////    public static void main(String[] args) throws Exception {
////        SpringApplication.run(ChannelController.class, args);
////    }
//
//}